package com.hbnu.tonghengchang;

class Employee {
    private String name;
    private double salary;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public Employee(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public double calculateBonus() {
        return salary * 0.1;
    }
}

class Manager extends Employee {
    public Manager(String name, double salary) {
        super(name, salary);
    }

    @Override
    public double calculateBonus() {
        return super.calculateBonus() + 1000;
    }
}

class Developer extends Employee {
    public Developer(String name, double salary) {
        super(name, salary);
    }

    @Override
    public double calculateBonus() {
        return super.calculateBonus() + 500;
    }
}

class test {
    public static void main(String[] args) {
        Manager mg = new Manager("张三", 7000);
        Employee em = new Employee("李四", 5000);
        Developer dp = new Developer("王五", 6000);
        double mgSalary = mg.calculateBonus();
        double emSalary = em.calculateBonus();
        double dpSalary = dp.calculateBonus();

        System.out.println("mg=" + (mg.getSalary()+mgSalary));
        System.out.println("em=" + (em.getSalary()+emSalary));
        System.out.println("dp=" + (dp.getSalary()+dpSalary));
    }
}

